package com.jonas.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	
	public static Date getStringToDate(String date){
		
		Date dateTime = null;
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		
		try {
			dateTime = sdf.parse(date);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return dateTime;
		
	}
	
	public static String getDateToString(Date date){
		
		String dateTime = null;
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		
		try {
			dateTime = sdf.format(date);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return dateTime;
		
	}

}
